package com.tom.architect02.ui10.day10;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import com.tom.architect02.R;

public class MainActivityUI10 extends AppCompatActivity {
    private TouchView mTouchView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_ui10);

        mTouchView = findViewById(R.id.touch_view);
        mTouchView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                Log.e("TAG0607", "onTouch " + event.getAction());
                return true;
            }
        });

        mTouchView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.e("TAG0607", "MainActivityUI10 onClick event-- ");
            }
        });
    }

//    return false // OnTouchListener::onTouch
//     E/TAG0607: onTouch 0
//     E/TAG0607: onTouchEvent-- 0
//     E/TAG0607: onTouch 2
//     E/TAG0607: onTouchEvent-- 2
//     E/TAG0607: onTouch 1
//     E/TAG0607: onTouchEvent-- 1
//     E/TAG0607: onTouch onClick event--

//    return true;  // onTouch
//     E/TAG0607: onTouch event-- 0
//     E/TAG0607: onTouch event-- 2
//     E/TAG0607: onTouch event-- 1
    // 不会触发onClick事件。



}